#include "StdAfx.h"
/// Copyright 2013, Alex Averian, Yonan Research
/// Released under BSD Licence


#include "qcaret.h"
using namespace micro::gui;

QCaret::QCaret( )
{
    m_parent = nullptr;

}
QCaret::~QCaret()
{
    Destroy();
}

///The size of the caret, in logical units.
bool QCaret::Create( QWindow * parent, int cx, int cy )
{
    m_parent = parent;
    BOOL bo =  ::CreateCaret( m_parent->GetHandle(), nullptr, cx,  cy );

    return bo == TRUE;
}
void  QCaret::Destroy()
{
    ::DestroyCaret();

}
void  QCaret::SetPos( int x, int y )
{
    ::SetCaretPos( x, y );
}

bool QCaret::ShowCaret()
{
    BOOL bo = ::ShowCaret( m_parent->GetHandle() );

    return bo == TRUE;
}
bool QCaret::HideCaret()
{
    //are numaratoare
    BOOL bo = ::HideCaret( m_parent->GetHandle() );

    return bo == TRUE;
}


